home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
ftp.cs.arizona.edu
/
ftp.cs.arizona.edu.tar
/
ftp.cs.arizona.edu
/
icon
/
newsgrp
/
group92c.txt
/
000029_icon-group-sender _Mon Oct 19 16:24:16 1992.msg
< prev
next >
Wrap
Internet Message Format
|
1993-01-04
|
2KB
Received: by cheltenham.cs.arizona.edu; Tue, 20 Oct 1992 09:17:38 MST
Date: 19 Oct 92 16:24:16 GMT
From: cis.ohio-state.edu!pacific.mps.ohio-state.edu!linac!uchinews!ellis!goer@ucbvax.Berkeley.EDU (Richard L. Goerwitz)
Organization: University of Chicago Computing Organizations
Subject: Re: sortf - sortff?
Message-Id: <1992Oct19.162416.28966@midway.uchicago.edu>
References: <1992Oct14.050320.9087@midway.uchicago.edu>, <1992Oct19.092116.18168@eua.ericsson.se>
Sender: icon-group-request@cs.arizona.edu
To: icon-group@cs.arizona.edu
Status: R
Errors-To: icon-group-errors@cs.arizona.edu
konhks@eua.ericsson.se writes:
>>Version 8 of Icon has sortf. Seems useful. But what if you want to
>
>'sortf'? Ain't heard of no such thing.
It's in the specs for the latest version. Sortf, I believe, is 8.6+. A
very useful tool. I kinda wish it had arbitrary final arguments, i.e.
sortf(struct, 1) would sort on field 1, while sortf(struct, 1, 2) would
sort on field 1, and for objects with the same field one, on field 2 as
well. This would be easy to prototype if there were, in addition to the
=== a >>>= and <<<= operator, defined to work on structures as well as
cset, strings, ints, and reals. I think that symmetry requires such
operators, and that, because there is no need to restrict sortf to one
field, it should not be so restricted.
I've written an Icon prototype of sortf that takes arbitrary arguments if
anyone wants it. It calls sortf, though, to determine sort order, so it
is slow. If there were <<<=, etc. I'd have been able to do a manual merge
or quicksort+insertion sort, which might or might not have been faster. I
still haven't fully figured RTL out, or I might have tried implementing it
as part of the run-time system.
>When I do more complex sorting jobs I write a file and run Unix 'sort' on it.
That would be fine except that, under some conditions, it's considered bad
programming practice to use platform-specific facilities. UNIX is certainly
not the only OS I use, or plan to use, so in my particular case piping output
through sort is not an ideal solution.
--
-Richard L. Goerwitz goer%midway@uchicago.bitnet
goer@midway.uchicago.edu rutgers!oddjob!ellis!goer